package com.bailiban.entity;


import com.bailiban.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * (Syslog)实体类
 *
 * @author zhulang
 * @since 2020-11-06 10:12:36
 */
public class Syslog implements Serializable {
    private static final long serialVersionUID = 237037705643531214L;

    private Integer id;
    /**
     * 访问时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date visittime;
    private String visittimeStr;
    /**
     * 操作者用户名
     */
    private String username;
    /**
     * 访问ip
     */
    private String ip;
    /**
     * 访问来源url
     */
    private String url;
    /**
     * 执行时长
     */
    private Integer executiontime;
    /**
     * 访问方法
     */
    private String method;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getVisittime() {
        return visittime;
    }

    public void setVisittime(Date visittime) {
        this.visittime = visittime;
    }

    public String getVisittimeStr() {
        if (this.visittime != null) {
            this.visittimeStr = DateUtils.date2String(this.visittime, "yyyy-MM-dd HH:mm:ss");
        }
        return visittimeStr;
    }

    public void setVisittimeStr(String visittimeStr) {
        this.visittimeStr = visittimeStr;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getExecutiontime() {
        return executiontime;
    }

    public void setExecutiontime(Integer executiontime) {
        this.executiontime = executiontime;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }
}